//
//  NIbLoadable.swift
//  SmallParts
//
//  Created by 航汇聚 on 2019/11/26.
//  Copyright © 2019 BellaZhou. All rights reserved.
//

import UIKit
protocol NibLoadable {
}
extension NibLoadable where Self : UIView {
    static func loadFromNib(_ nibName: String? = nil) -> Self {
        let loadName = nibName == nil ? "\(self)" : nibName!
        return Bundle.main.loadNibNamed(loadName, owner: self, options: nil)?.first as! Self
    }
}
